package com.education.platform.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.education.platform.entity.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 学生Mapper接口
 *
 * @author education-platform
 * @since 2024-09-27
 */
@Mapper
public interface StudentMapper extends BaseMapper<Student> {

    /**
     * 根据家长ID查询学生列表
     */
    List<Student> selectByParentId(@Param("parentId") Long parentId);

    /**
     * 根据年级查询学生列表
     */
    List<Student> selectByGrade(@Param("grade") String grade);

    /**
     * 统计家长的学生数量
     */
    Integer countByParentId(@Param("parentId") Long parentId);
} 